import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { MemberCenterHomeComponent } from './member-center-home/member-center-home.component';
import { ProjectDetailComponent } from './projectDetail/projectDetail';
import { ReportSubmitComponent } from './report/reportSubmit';
import { ProjectDetailActivate, MyBugsActivate, BugDetailActivate } from 'src/app/core/auth/auth.guard';
import { MyReportComponent } from './report/myReport';
import { RedTeamComponent } from './redTeam/redTeam';
import { MyProjectComponent } from './myProject/myProject';
import { AboutUsComponent } from './aboutus/aboutus';
import { HelpComponent } from './help/help';
import { BugDetailComponent } from './bugDetail/bugDetail';
import { NoticeListComponent } from './notice/notice';
import { NoticeDelComponent } from './notice/noticeDel';
import { IndexComponent } from './index';
import { SecurityComponent } from './security/security';
import { LoginComponent } from '../pages/login/login.component';
import { RegisterComponent } from '../pages/register/index.component';

const routes: Routes = [
    {
        path: '',
        children: [
            {
                path: '',
                redirectTo: 'home.index',
            },
            {
                path: 'home',
                component: MemberCenterHomeComponent,
                data: {
                    title: '工作台',
                    translate: 'member-center.home'
                },
                children: [{
                    path: 'index',
                    component: IndexComponent,
                    data: {
                        title: '首页',
                        translate: 'member-center.home.index'
                    }
                }, {

                    path: 'login',
                    component: LoginComponent,
                    data: {
                        title: '登录',
                        translate: 'member-center.home.login'

                    }
                },{
                    path: 'myProject',
                    component: MyProjectComponent,
                    data: {
                        title: '我要检测',
                        translate: 'member-center.home.myProject'
                    }
                }, {
                    path: 'projectDetail',
                    component: ProjectDetailComponent,
                    data: {
                        title: '项目详情',
                        translate: 'member-center.home.projectDetail'
                    },
                    resolve: {
                        userDel: ProjectDetailActivate,
                    },
                }, {
                    path: 'queryList',
                    component: NoticeListComponent,
                    data: {
                        title: '查询列表',
                        translate: 'member-center.home.queryList'
                    }
                }, {
                    path: 'bzwx',
                    component: RedTeamComponent,
                    data: {
                        title: '标准文献',
                        translate: 'member-center.home.bzwx'
                    }
                },{
                    path: 'jcSubmit',
                    component: ReportSubmitComponent,
                    data: {
                        title: '创建检测申请单',
                        translate: 'member-center.home.jcSubmit'
                    }
                },{
                    path: 'register',
                    component: RegisterComponent,
                    data: {
                        title: '注册',
                        translate: 'member-center.home.register'

                    }
                }]
            },
           
           
           
            {
                path: 'myReport',
                component: MyReportComponent,
                data: {
                    title: '我的漏洞',
                    translate: 'member-center.myReport'
                },
                resolve: {
                    userDel: MyBugsActivate
                },
            },
            
            {
                path: 'aboutus',
                component: AboutUsComponent,
                data: {
                    title: '关于我们',
                    translate: 'member-center.aboutus',
                }
            },
            {
                path: 'bugDetail',
                component: BugDetailComponent,
                data: {
                    title: '漏洞详情',
                    translate: 'member-center.bugDetail'
                },
                resolve: {
                    data: BugDetailActivate
                }
            },          
            {
                path: 'noticeDel',
                component: NoticeDelComponent,
                data: {
                    title: '消息详情',
                    translate: 'member-center.noticeDel'
                }
            },
            {
                path: 'security',
                component: SecurityComponent,
                data: {
                    title: '信息安全相关保护和申明',
                    translate: 'member-center.security'
                }
            },
            {
                path: '**',
                redirectTo: 'home/index'
            },
        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class MemberCenterRoutingModule { }
